git

Section: User Commands (1)
Updated: January 1995
Index Return to Main Contents
 

NAME

git - GNU Interactive Tools version 4.3.6  

SYNTAX

git
gitps [ps(1) like parameters]
gitview filename

 

NOTE

The main configuration file of the GIT package is .gitrc.TERM where TERM is the value of the environment variable 'TERM' e.g for Linux console your environment contains something like 'TERM=console' so the configuration file name is .gitrc.console. You can (and should) have a configuration file for each terminal type you use.

 

DESCRIPTION

git is a file system browser with some shell facilities which was designed to make your work much easier and much efficient.

gitps is an interactive process viewer/killer. It calls internally the ps(1) utility so that's the reason why gitps parameters are in fact ps(1) ones. Running gitps it is self explanatory. Use the arrows, PageUp, PageDown, Home, End, ^N, ^P, ^V, ESC v to move in the list, ^L to refresh it and F10 or ^G to leave. You can change these keys, just read the sections [GITPS-Setup], [GITPS-Color], [GITPS-Monochrome] and [GITPS-Keys] in the configuration file .gitrc.TERM. See also CONFIGURATION FILES.

gitview is an hex/ascii file viewer. Too simple to need a separate manual page. Use the arrows, PageUp, PageDown, Home, End, ^N, ^P, ^V, ESC v to move in the file, ^L to refresh the screen and F10 or ^G to leave. You can change those keys, just read the sections [GITVIEW-Setup], [GITVIEW-Color], [GITVIEW-Monochrome] and [GITVIEW-Keys] in the configuration file .gitrc.TERM. See also CONFIGURATION FILES.

 

FILE-SYSTEM BROWSER

git is made of two panels. The left one and the right one. Each one contains a file system directory. You can browse the directory tree with the usual cursor keys and pressing ENTER when you want to enter or leave a directory. You may change the panels by pressing TAB. See also BUILT-IN COMMANDS.

 

INPUT LINE

Under the two panels there is a shell like input line which you can use to type normal shell commands. The input line supports unlimited characters and keeps a history of the typed commands. GIT uses the GNU history library for that. See also BUILT-IN COMMANDS.

 

WARNINGS AND ERRORS REPORTING

Under the input line there is a status bar. You can see there the status of the currently executed command, the warnings and errors and you will be prompted if a decision has to be taken.

 

ENVIRONMENT VARIABLES

The configuration files use shell environment variables to call the shell, editor, mail reader, compress and virtual memory status utility. That means that if you set GIT_SHELL, GIT_EDITOR, GIT_RMAIL, GIT_COMPRESS or GIT_VMSTAT to some value, that value will be used instead of the default one. The defaults are:

GIT_SHELL='/bin/sh'
GIT_EDITOR='vi'
GIT_RMAIL='emacs -f rmail'
GIT_COMPRESS='gzip -9'
GIT_VMSTAT='free'

If GIT_SHELL is not defined but SHELL is, GIT_SHELL will be set to that value. If GIT_EDITOR is not defined but EDITOR is, GIT_EDITOR will be set to that value. If you want to change the default settings, put something like this into your .profile :

export GIT_SHELL='/usr/local/bin/bash'
export GIT_EDITOR='emacs'
export GIT_RMAIL='elm'
export GIT_COMPRESS='compress'
export GIT_VMSTAT='vmstat'

 

CONFIGURATION FILES

There is one configuration file per terminal type in git/gitps/gitview. The configuration file(s) resides in the user's home directory or (the default versions) in the directory $(prefix)/lib (usually /usr/local/lib). The generic name is .gitrc.TERM. GIT allows each terminal type to have its own configuration file (TERM is the value of the 'TERM' environment variable (e.g vt102). For the Linux console the configuration file is .gitrc.console).

If you have compiled the GIT package with HAVE_LIBTERMCAP and your system has a huge termcap database (/etc/termcap), you can copy the termcap definition(s) of your terminal(s) in a file ($HOME/.termcap e.g.). After that, set your TERMCAP environment variable to point to it. You should add something like this to your .profile:

TERMCAP=/home/mike/.termcap

git/gitps/gitview can run without such a file, but on systems with huge termcap databases, copying the definitions of the most used terminals in a local .termcap will result in git/gitps/gitview starting faster. git/gitps/gitview doesn't use termcap key definitions. You must define the keys you want directly in the .git.TERM file in [GITxxx-Keys] sections.

If you have compiled the GIT package with HAVE_LIBTERMINFO, or on your system the termcap database is emulated using the terminfo library (like in the HP-UX system), don't bother about speed.

See also the sections [GITxxx-Keys].

The configuration file .gitrc.TERM is the file searched by git/gitps/gitview each time they are started, in order to configure themselves. .gitrc.TERM it is first searched in the home directory then, if not found, in the directory $(prefix)/lib (usually /usr/local/lib). The configuration file is structured on sections, each section containing variables in the following format:

variable_name = first_field;second_field; ...

After the variable_name at least one space or tab is required. All characters after a '#' are ignored and if you comment a section name, the whole section is ignored.

The default configuration file .gitrc.TERM supports most of the usual commands. To find out more about them please read it. git allows you to change both the utility used to perform a particular operation (using compress instead of gzip :-) ) and the key associated with it. There is also possible to remove/add new commands.

The configuration file contains the following sections:

1. [Setup]

In this section the variables have only one field.

a. TempDirectory

 - this variable specifies the location of the temporary files created by git.

b. AnsiColors

 - this variable should be set to ON if the terminal supports standard ANSI color sequences. Otherwise it should be OFF. If AnsiColors is ON, [GITxxx-Color] sections will be used in the configuration files .gitrc.TERM. Otherwise, git/gitps/gitview will use the [GITxxx-Monochrome] sections.

c. UseLastScreenChar

 - this variable is used for terminals that can't write on the last character of the screen without scrolling the entire screen. If your terminal has no problem writing there (Linux console, vt100, vt102, xterm, ...) set it to ON. Otherwise (hpterm), it should be OFF.

2. [GIT-Setup]

In this section the variables have only one field.

a. StartupFileDisplayMode
 - this variable specifies the file specific information displayed at startup. It can be any of OwnerGroup , DateTime , Size , Mode or FullName.
 - this value initially affects both panels but it can be changed separately afterward.

b. StartupFileSortMethod


 - this variable specifies the startup sort method. It can be any of Name , Extension , Size , Date , Mode , OwnerId , GroupId , OwnerName or GroupName.
 - this value initially affects both panels but it can be changed separately afterward.

c. StartupLeftPanelPath
d. StartupRightPanelPath
 - those variables specifies the startup path for each panel.

e. HistoryFile
 - this variable specifies the history file name. The default value is ~/.githistory.

f. NormalModeHelp
g. CommandLineModeHelp
 - those variables describe the status bar contents for each git mode when no errors occurred (git is idle). git can display on the status bar a help string and/or some system information (system type, hostname, machine type and the current date) using escape characters (s, h, m or d preceded by backslash): s -> the system type
h -> the host name
m -> the machine type
d -> the current date
See also show-terminal.

h. InfoDisplay
 - if this variable is OFF, auxiliary file informations are not displayed. This can be useful if you are using a very slow terminal.

i. LeadingDotMatch


 - if this variable is OFF, when matching files for select-files-matching-pattern / unselect-files-matching-pattern then the leading '.' in the file name is matched only explicitly.

3. [GITPS-Setup]

In this section the variables have only one field.

a. GitPsModeHelp
 - this variable describe the gitps status bar contents.

4. [GITVIEW-Setup]

In this section the variables have only one field.

a. GitViewModeHelp
 - this variable describe the gitview status bar contents.

5. [GITxxx-Color] / [GITxxx-Monochrome]

In this sections the variables have only one field.

These sections permits you to customize the colors of git, gitps and gitview. Reading the .gitrc.TERM configuration file should be self explanatory. See also the [Setup] section.

6. [GIT-Keys]

This section describes the actions git takes when a specified key is pressed. In this section a variable can have up to 6 fields separated by ';'. Each line in this section looks like:

key_sequence = command_name;formatted_command;new_dir;
save_screen;pause;hide

WARNING : you can't continue the variable fields description on the next line.

a. key_sequence
 - key_sequence is the key sequence associated with the given command. You can use any key sequence wich doesn't start with an ascii character (0x20 to 0x7e). You can specify the ESC character as ^[ , the ^ character as ^^ , the backspace character as ^_ , the ctrl-space character as ^$ and the space character as ^@ . Ascii characters are used by the input line.

You can use some symbolic key names instead of the key sequence: F0, F1, F2, ... F10, UP, DOWN, RIGHT, LEFT, INS, DEL, HOME, END, PGUP and PGDOWN. For the function & cursor keys, it's a better idea to get the key sequences from the termcap/terminfo database if they can be found there. So, the command for the F1 key on the Linux console (the configuration file is .gitrc.console) can be:
               F1 = GIT-HELP; man git

       or

               ^[A = GIT-HELP; man git

If some key doesn't have a termcap/terminfo description (like the F11/F12 keys on the Linux console) you can specify the key sequence in the usual way.

b. command_name
 - command_name is a command generic name. Even if it is not always used, the command_name must be present (if a command is associated with key_sequence). If it is not, no action will be taken when pressing key_sequence. There are two types of commands in git : built-in commands and user defined commands. If the command_name section contains a built-in command specification (copy, move, make-directory etc), the other fields are ignored.

The BUILT-IN COMMANDS are:

copy
 - copies files from one panel to another.

move
 - moves files from one panel to another.

make-directory
 - makes directories.

delete
 - deletes files and directories.

exit
 - exits git.

previous-history-element
 - copies to the input line the previous command in the history list.

show-terminal
 - switches between the two git modes (starting with Linux 0.99.12 this option is completely used only if you are super user because normal users can't do a screen dump).

refresh
 - refreshes the contents of the current panel.

switch-panels
 - switches the left panel with the right one.

next-history-element
 - copies the next command in the history list to the input line.

panel-display-next-mode
 - switches to the next file display mode.

panel-display-owner-group
 - displays the file owner & group.

panel-display-date-time
 - displays the file date & time.

panel-display-size
 - displays the file size.

panel-display-mode
 - displays the file mode.

panel-display-full-name
 - displays the full file name (if possible).

panel-sort-next-method
 - switches to the next sort method.

panel-sort-by-name
 - sorts the files by extension.

panel-sort-by-extension
 - sorts the files by name.

panel-sort-by-size
 - sorts the files by size.

panel-sort-by-date
 - sorts the files by date.

panel-sort-by-mode
 - sorts the files by mode.

panel-sort-by-owner-id
 - sorts the files by owner id.

panel-sort-by-group-id
 - sorts the files by group id.

panel-sort-by-owner-name
 - sorts the files by owner name.

panel-sort-by-group-name
 - sorts the files by group name.

select-file
 - selects/unselects files. All the files can be selected by pressing '+' (and ENTER) or unselected by pressing '-'. By pressing '*' selected files becomes unselected and unselected files becomes selected.

file-to-input-line
 - copies to the input line the current file name .

beginning-of-panel
 - puts the cursor onto the first entry in the current directory list.

end-of-panel
 - puts the cursor onto the last entry in the current directory list.

scroll-down
 - puts the cursor up one page in the current directory file list.

scroll-up
 - puts the cursor down one page in the current directory file list.

previous-line
 - puts the cursor up one entry in the current directory file list.

next-line
 - puts the cursor down one entry in the current directory file list.

other-panel
 - puts the cursor in the other panel.

change-directory
 - changes the current directory to a user specified directory.

hard-refresh
 - forces a screen refresh.

select-files-matching-pattern
 - selects files matching a given pattern.

unselect-files-matching-pattern
 - unselects files matching a given pattern.

conform-current-directory
 - the other panel current directory will become the current directory of the current panel.

conform-other-directory
 - the current directory of the current panel will become the current directory of the other panel.

other-path-to-input-line
 - copy the other panel path to the input line.

selected-files-to-input-line
 - copy all the current panel selected file names to the input line.

backward-char
 - Move the point backward one character.

forward-char
 - Move the point forward one character.

backward-word
 - Move the point backward one word.

forward-word
 - Move the point forward one word.

beginning-of-line
 - Move the point at the beginning of the line.

end-of-line
 - Move the point at the end of the line.

delete-char
 - Delete the character at the point.

backward-delete-char
 - Delete the character before the point.

backward-kill-word
 - Kill characters backward until encountering the end of a word.

kill-line
 - Delete the entire input line.

kill-to-beginning-of-line
 - Delete the text between the beginning of the line and the point.

kill-to-end-of-line
 - Delete the text between the point and the end of line.

just-one-space
 - Remove all the tabs and spaces arround the point, leaving just one space.

delete-horizontal-space
 - Remove all the tabs and spaces arround the point.

action
 - If the current file is executable, runs it.  If it is a directory, chdir to it.

set-mark
 - Set mark where point is.

kill-region
 - Kill between point and mark.  The text is deleted but saved in the kill ring.

kill-ring-save
 - Save the region as if killed, but don't kill it.

yank
 - Reinsert the last stretch of killed text.

exchange-point-and-mark
 - Exchange point and mark.

c. formatted_command
 - formatted_command is a shell command which can contain some scanf like format specifiers. With their help you can get the current directory entry name (the directory entry under the cursor), owner, group and mode. These are the available format specifiers:


 - %s{question,default_answer}
When git encounters a %s in the formatted_command asks the user the question 'question' whose default answer is 'default_answer' and replaces the %s{ , } with the user answer. Both 'question' and 'default_answer' can contain any other format specifiers except %s.

WARNING : no spaces between %s and '{'.


 - %f
git will replace %f with the current directory entry name only if it is a file (not a directory).


 - %d
git will replace %d with the current directory entry name only if it is a directory (not a file).


 - %l
git will replace %l with the current directory entry name only if it is a symbolic link with no target.


 - %t
git will replace %t with the current directory entry name only if it is a named pipe.


 - %z
git will replace %z with the current directory entry name only if it is a socket.


 - %a
git will always replace %a with the current directory entry name.


 - %m
git will always replace %m in the formatted_command with the current file mode.


 - %g
git will always replace %g in the formatted_command with the current file group.


 - %o
git will always replace %o in the formatted_command with the current file owner.


 - %p
git will always replace %p in the formatted_command with the current panel path.


 - %b
git will always replace %b in the formatted_command with the current panel directory name.


 - %i
git will always replace %i in the formatted_command with all the current panel selected file names.

Using uppercase format specifiers you will be able to access the other panel path, file and directory names.

d. new_dir
 - if the formatted_command successfully exits (exit code = 0) and this field is present then new_dir will become the current panel directory. The character ~ used at the begining of the new_dir field is replaced by the user's home directory.

e. save_screen
 - this field is an character (usually 'y' or 'n') who tells git to save ('y') or not to save ('n') the terminal screen after executing the formatted_command. Saving the screen is not necessary while editing or viewing a file because the information left after the editor or the viewer exits is not important. Saving the screen means that that screen will be restored before the execution of the next command. This field is used only if you are super user under Linux and you are working on a virtual console. By default this field is 'y'.

f. pause
 - for some commands you may wish to read their results before
repainting the panels. If this field is present git will wait for a key to be pressed before restoring the panels. By default this field is 'n'.

g. hide
 - there are some commands that aren't displaying any useful information if successfully complete their execution: mount, chmod, chown, chgrp, sync ... and if an error occurs then a line or two are sended to stderr. If this option is 'y', the stdout and stderr
will be redirected to some files (stdout.pid and stderr.pid , where pid is git pid) and only if the command exit code is not 0, the stderr.pid file will be displayed, line by line, onto the status bar. This way the panels will not be deleted and then repainted and the command appears to be built-in. stdout.pid and stderr.pid are created in the TempDirectory specified in the [Setup] section. By default this field is 'n'.

The default configuration file $HOME/.gitrc.TERM supports most of the usual commands. To find out more about them please read it. git allows you to change both the utility used to perform a particular operation (using compress instead of gzip :-) ) and the key associated with it. There is also possible to remove/add new commands.

7. [GITPS-Keys]

This section describes the actions gitps takes when a specified key is pressed. In this sections the variables have only one field. Only built-in operations are available in gitps. Each line in this section looks like:

key_sequence = built_in_command_name

a. key_sequence
 - key_sequence is the key sequence associated with the given command. You can use any key sequence wich doesn't start with an ascii character (0x20 to 0x7e). You can specify the ESC character as ^[ , the ^ character as ^^ and space as ^@ .

b. built_in_command_name
 - built_in_command_name is the name of the built-in operation to run when key_sequence is pressed. The built-in operations are:

- previous-line - moves to the previous process in the processes list
- next-line - moves to the next process in the processes list
- scroll-down - moves one page up in the processes list
- scroll-up - moves one page down in the processes list
- beginning-of-panel - moves to the first process in the processes list
- end-of-panel - moves to the last process in the processes list
- next-signal - sets the next signal in the signals list as the current signal
- SIGHUP
- SIGINT
- SIGQUIT
- SIGILL
- SIGFPE
- SIGKILL
- SIGUSR1
- SIGSEGV
- SIGUSR2
- SIGPIPE
- SIGALRM
- SIGTERM
- SIGCHLD
- SIGCONT - sets the SIG... signal as the current signal
- kill-process - sends the current signal to the current process
- refresh - refresh the processes list by re-calling ps(1)
- hard-refresh - force the screen refresh the screen by re-calling ps(1) and invalidating the terminal cache.
- exit - exits

8. [GITVIEW-Keys]

This section describes the actions gitview takes when a specified key is pressed. In this sections the variables have only one field. Only built-in operations are available in gitview. Each line in this section looks like:

key_sequence = built_in_command_name

a. key_sequence
 - key_sequence is the key sequence associated with the given command. You can use any key sequence wich doesn't start with an ascii character (0x20 to 0x7e). You can specify the ESC character as ^[ , the ^ character as ^^ and space as ^@ .

b. built_in_command_name
 - built_in_command_name is the name of the built-in operation to run when key_sequence is pressed. The built-in operations are:

- previous-line - moves to the previous line (16 bytes) in the file
- next-line - moves to the next line (16 bytes) in the file
- scroll-down - moves one page up (0x100 bytes) in the file
- scroll-up - moves one page down (0x100 bytes) in the file
- beginning-of-panel - moves to the beginning of the file
- end-of-panel - moves to the end of the file
- refresh - refresh the screen by re-reading the file
- hard-refresh - force the screen refresh the screen by re-reading the file and invalidating the terminal cache.
- exit - exits

 

CANCELING OPERATIONS

All built-in operations and input requests can be stopped by pressing ^G.
git can be suspended by pressing ^Z.

 

LIMITATIONS

1. Background execution is not fully supported. That means you may specify an & terminated command line in the configuration file but the result of the background executed command (stdout and stderr redirection, as explained before) will be overwritten by the result of newer commands and, if an error occurs, you will not see it.

2. When git is compiled for Linux, the default built-in color descriptions are for color monitors, so you can't (decently) run git on a b/w monitor without the .gitrc.TERM file correctly configured. .gitrc.TERM should be configured with ColorMonitor = OFF. If you are working on a serial b/w tty, LinuxConsole should be OFF too.

3. Job support is implemented only in git.

4. Due to the fact that the ';' character is used as a field separator in the configuration files, you can't write something like that in the .gitrc.TERM files:

^AAA = SHOW-USERS-AND-GROUPS; more /etc/passwd; more /etc/group

because 'more /etc/group' will be considered as a directory to switch to. You must write a small script instead:

#!/bin/sh
more /etc/passwd; more /etc/group

Supposing the script name is 'show_ug' , the .gitrc.TERM line will be like that:

^AAA = SHOW-USERS-AND-GROUPS; show_ug

 

BUGS

These manual page is obsolete. It documents version 4.3.5 of the GNU Interactive Tools package. Only the GIT's info documentation is being updated.

Please send bug reports to:
tudorh@pub.ro

 

SEE ALSO

termcap(5) terminfo(5) sh(1) ps(1) mount(8) umount(8) gitaction(1) gitmount(1) gitcmp(1) gitkeys(1) gitredir(1) gitrgrep(1)

 

FILES

/usr/local/bin/git
/usr/local/bin/gitps
/usr/local/bin/gitview
/usr/local/man/man1/git.1
/usr/local/man/man1/gitps.1
/usr/local/man/man1/gitview.1
/usr/local/info/git.info
/usr/local/lib/.gitrc.TERM
$HOME/.gitrc.TERM

 

AUTHORS

Tudor Hulubei
- tudorh@pub.ro
Andrei Pitis
- pink@pub.ro
Politehnica University of Bucharest
Romania


 

Index

NAME
SYNTAX
NOTE
DESCRIPTION
FILE-SYSTEM BROWSER
INPUT LINE
WARNINGS AND ERRORS REPORTING
ENVIRONMENT VARIABLES
CONFIGURATION FILES
CANCELING OPERATIONS
LIMITATIONS
BUGS
SEE ALSO
FILES
AUTHORS

This document was created by man2html, using the manual pages.
Time: 14:04:45 GMT, November 05, 2024